Topics to Research - Coding Inefficiencies

Final Project Part 1 (later this semester), is to identify "Coding Inefficiencies" often found in code. While there are many examples of "Coding Inefficiencies", the ones which are coved on Final Project Part 1 are listed below.

 

Your job this week is to research the following topics. The only artifact you are to submit this week is a screenshot of one site where you did some research. When you take the Final Project Part 1, we will find out then how well you researched the topics below. For the first topic below, I provided one example of poor or repetitive logic.

 

 

 1. Poor or repetitive logic - An example of poor logic would be when the programmer is asked to sum the first 1,000,000 numbers and does the following:

total=0

for i in range (1000001):

    total = total + i

print(total)

 

instead of taking the well-known mathematics short cut of (1,000,000 * 1,000,001)/2 = 500,000,500,000

 

 2. Using bad versus good variable and function names

 3. Failing to use adequate comments

 4. Using repetitive code instead of loops

 5. Failing to implement 'versioning' correctly

 6. Repetitive logic

 7. Hard coding

 8. Global variables - good or bad?

 9. Global constants - good or bad?

 

Good luck!

I hope that helps,

Dr. Jim